Some embodiments of the present disclosure are directed to an improved approach for implementing a self-governed, contention-aware approach to scheduling file defragmentation.
Legacy defragmentation implementations attempt to coalesce (e.g., defragment) the entire disk by moving the contents of disk blocks around the physical storage spaces of the disk in order to create contiguous usage of space within files. Such legacy defragmentation approaches are unaware of the usage of files that are being defragmented. Often conventional approaches even require the file system to be offline. When the file system is offline, it is moot to consider the performance effect that the defragmentation operations have on the system, however taking a file system offline is highly undesirable, and improvements to avoid taking a file system offline are needed.
Some legacy approaches have attempted to perform defragmentation operations while online by requiring that the user identify a particular file to be defragmented and to explicitly issue a command to perform the defragmentation. While such a naive approach can prevent contentious access to the file until the entire defragmentation operation is completed, that approach fails to consider the user impact of many hundreds or thousands of files on a system disk. Indeed, legacy cases fail to consider the user impact of concurrently performing defragmentation of many hundreds or thousands of files on a system disk. What is needed is a technique for delaying defragmentation operations when the contention increases or when the system utilization gets above a threshold value.
Further, the aforementioned legacy techniques fail to implement techniques that permit defragmentation while online, and accordingly the aforementioned legacy techniques fail to fairly schedule workload or otherwise consider system resource sharing while online. Specifically, the aforementioned technologies do not have the capabilities to perform a self-governed, contention-aware approach to scheduling file defragmentation of an online volume. Therefore, there is a need for an improved approach.